package com.xugongzhang.test;

import com.xugongzhang.spring.config.MainConfigOfPropertyValues;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author X
 * @date 2022/12/3 21:19
 */
public class BeanLife {
    
    @Test
    public void test1() {
        // 创建ioc容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfPropertyValues.class);
        String age = applicationContext.getEnvironment().getProperty("dog.age");
        System.out.println("age=" + age);
    }
}
